package provider.controller;

import cn.johnyu.commons.model.Product;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@ConfigurationProperties(prefix = "product")
@Data
public class ProviderController {
    private double discount;
    @GetMapping("/product")
    public Product findProduct(){
        double price=3999.00;
        return new Product().setId(1).setName("iPhone").setPrice(price * discount);
    }
}
